﻿using System;
using Autodesk.Revit.DB;

namespace QuickModel.Demo
{
	public class LineElement : CurveCadElement
	{
		public override bool IfIntersection(CurveCadElement inputCurve)
		{
			return false;
		}

		public override bool IfParallel(CurveCadElement inputCurve)
		{
			Line line = this.ThisCurve as Line;
			Line line2 = inputCurve.ThisCurve as Line;
			bool flag = Math.Abs(line.Length - line2.Length) > 1E-06;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				bool flag2 = !line.Direction.IsAlmostEqualTo(line2.Direction) && !line.Direction.IsAlmostEqualTo(-line2.Direction);
				if (flag2)
				{
					result = false;
				}
				else
				{
					bool flag3 = line.Project(line2.GetEndPoint(1)).XYZPoint.IsAlmostEqualTo(line.GetEndPoint(1)) || line.Project(line2.GetEndPoint(1)).XYZPoint.IsAlmostEqualTo(line.GetEndPoint(0));
					result = flag3;
				}
			}
			return result;
		}
	}
}
